package com.yc.tc.beans;

import java.io.Serializable;

/**
 * 会员信息表
 * 
 * @author Henry
 * 
 */
public class UserInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	private int usid; // 会员编号
	private String email; // 邮箱
	private String uname; // 会员名
	private String tname; // 真实姓名
	private String pwd; // 密码
	private String tel; // 联系方式
	private String province; // 省份
	private String city; // 城市
	private String area; // 地区
	private String idcard; // 证件号码
	private int sex; // 性别
	private String photo; // 图像地址
	private String udate; // 注册时间
	private String QQ; // QQ号码
	private int status; // 状态
	private String temp;
	private String falg;

	@Override
	public String toString() {
		return "UserInfo [usid=" + usid + ", email=" + email + ", uname="
				+ uname + ", tname=" + tname + ", pwd=" + pwd + ", tel=" + tel
				+ ", province=" + province + ", city=" + city + ", area="
				+ area + ", idcard=" + idcard + ", sex=" + sex + ", photo="
				+ photo + ", udate=" + udate + ", QQ=" + QQ + ", status="
				+ status + ", temp=" + temp + ", falg=" + falg + "]";
	}

	public UserInfo(int usid, String email, String uname, String tname,
			String pwd, String tel, String province, String city, String area,
			String idcard, int sex, String photo, String udate, String qQ,
			int status, String temp, String falg) {
		super();
		this.usid = usid;
		this.email = email;
		this.uname = uname;
		this.tname = tname;
		this.pwd = pwd;
		this.tel = tel;
		this.province = province;
		this.city = city;
		this.area = area;
		this.idcard = idcard;
		this.sex = sex;
		this.photo = photo;
		this.udate = udate;
		QQ = qQ;
		this.status = status;
		this.temp = temp;
		this.falg = falg;
	}

	public UserInfo() {
		super();
	}

	public int getUsid() {
		return usid;
	}

	public void setUsid(int usid) {
		this.usid = usid;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getTname() {
		return tname;
	}

	public void setTname(String tname) {
		this.tname = tname;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	public int getSex() {
		return sex;
	}

	public String getSexs() {
		if (this.sex == 0) {
			return "男";
		} else {
			return "女";
		}
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public String getPhoto() {
		return photo;
	}

	public String getPhotos() {
		if(photo==null || "".equals(photo)){
			return "<img src='images/userPic.PNG' />";
		}else{
			if(photo.indexOf(",")>0){
				String str="";
				String[] fils=photo.split(",");
				for(String s:fils){
					str+="<img src='"+s+"'/>&nbsp;";
				}
				return str;
			}else{
				return "<img src='"+photo+"'/>";
			}
		}
	}
	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getUdate() {
		return udate;
	}

	public String getUdates() {
		if(udate!=null && "".equals(udate)){
			return udate.substring(udate.lastIndexOf(" "));
		}else{
			return udate;
		}
	}
	
	public void setUdate(String udate) {
		this.udate = udate;
	}

	public String getQQ() {
		return QQ;
	}

	public void setQQ(String qQ) {
		QQ = qQ;
	}

	public int getStatus() {
		return status;
	}

	public String getStatuss() {
		if (this.status == 0) {
			return "不可用";
		} else {
			return "可用";
		}

	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getTemp() {
		return temp;
	}

	public void setTemp(String temp) {
		this.temp = temp;
	}

	public String getFalg() {
		return falg;
	}

	public void setFalg(String falg) {
		this.falg = falg;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((QQ == null) ? 0 : QQ.hashCode());
		result = prime * result + ((area == null) ? 0 : area.hashCode());
		result = prime * result + ((city == null) ? 0 : city.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((falg == null) ? 0 : falg.hashCode());
		result = prime * result + ((idcard == null) ? 0 : idcard.hashCode());
		result = prime * result + ((photo == null) ? 0 : photo.hashCode());
		result = prime * result
				+ ((province == null) ? 0 : province.hashCode());
		result = prime * result + ((pwd == null) ? 0 : pwd.hashCode());
		result = prime * result + sex;
		result = prime * result + status;
		result = prime * result + ((tel == null) ? 0 : tel.hashCode());
		result = prime * result + ((temp == null) ? 0 : temp.hashCode());
		result = prime * result + ((tname == null) ? 0 : tname.hashCode());
		result = prime * result + ((udate == null) ? 0 : udate.hashCode());
		result = prime * result + ((uname == null) ? 0 : uname.hashCode());
		result = prime * result + usid;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserInfo other = (UserInfo) obj;
		if (QQ == null) {
			if (other.QQ != null)
				return false;
		} else if (!QQ.equals(other.QQ))
			return false;
		if (area == null) {
			if (other.area != null)
				return false;
		} else if (!area.equals(other.area))
			return false;
		if (city == null) {
			if (other.city != null)
				return false;
		} else if (!city.equals(other.city))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (falg == null) {
			if (other.falg != null)
				return false;
		} else if (!falg.equals(other.falg))
			return false;
		if (idcard == null) {
			if (other.idcard != null)
				return false;
		} else if (!idcard.equals(other.idcard))
			return false;
		if (photo == null) {
			if (other.photo != null)
				return false;
		} else if (!photo.equals(other.photo))
			return false;
		if (province == null) {
			if (other.province != null)
				return false;
		} else if (!province.equals(other.province))
			return false;
		if (pwd == null) {
			if (other.pwd != null)
				return false;
		} else if (!pwd.equals(other.pwd))
			return false;
		if (sex != other.sex)
			return false;
		if (status != other.status)
			return false;
		if (tel == null) {
			if (other.tel != null)
				return false;
		} else if (!tel.equals(other.tel))
			return false;
		if (temp == null) {
			if (other.temp != null)
				return false;
		} else if (!temp.equals(other.temp))
			return false;
		if (tname == null) {
			if (other.tname != null)
				return false;
		} else if (!tname.equals(other.tname))
			return false;
		if (udate == null) {
			if (other.udate != null)
				return false;
		} else if (!udate.equals(other.udate))
			return false;
		if (uname == null) {
			if (other.uname != null)
				return false;
		} else if (!uname.equals(other.uname))
			return false;
		if (usid != other.usid)
			return false;
		return true;
	}

}
